{block name=body} 
{* Define the function *} {function name=options_list level=0} 
    {foreach $opts as $opt}
        {if $level eq 0}
            <optgroup label="{$opt.value}">
        {else}
            <option value="{$opt.id}" {if $selected eq $opt.id}selected="selected"{/if}>{$opt.value}</option>
        {/if}
        {if count($opt.subs) > 0} {call name=options_list opts=$opt.subs level=$level+1 } {/if}
    {/foreach} 
{/function}

<div id="partycont">
    <div class="container">
        <div class="row">
            <div class="col-sm-9">
                <div class="visible-md visible-lg">
                    {include file='breadcrumbs.tpl'}
                </div>
                  <h1 class="title">{$listing_name}</h1>
                {$listing_content1}
            </div>
            <div class="col-sm-3 hidden-xs">
                  <img src="/images/aboutkid.png" alt="" class="img-responsive" />
            </div>
        </div>
    </div>
</div>

<div id="maincont">
    <div class="container pagecont">
        <div class="row">
            <div class="col-sm-12">
                {$listing_content2}
            </div>
            <div class="col-sm-12">
                    <span class="bold">{$config.company.name}</span><br />
                    {$config.company.business_name}<br /><br />

                <div class="row">
                    <div class="col-sm-5">
                    <span class="bold">{$lang.contact.contact}</span><br />
                    {$lang.contact.t}: <a href="tel://{$PHONE}">{$config.company.phone}</a><br />
                    {$lang.contact.f}: {$config.company.fax}<br />
                    {$lang.contact.e}: <a href="#form">{$config.company.email}</a>
                    </div>
                    
                    <div class="col-sm-4">
                    <span class="bold">{$lang.contact.address}</span><br />
                    {$config.company.address.state} {$config.company.address.suburb}<br />{$config.company.address.street}<br />
                    {$config.company.address.postcode}
                    </div>
                    
                    <div class="col-sm-3">
                    <span class="bold">{$lang.contact.hours}</span><br />
                    {$lang.contact.workday}<br />
                    {$lang.contact.workhour}
                    </div>

                </div>
            </div>

        </div>
    </div>
</div>

<div id="form">&nbsp;</div>    
<div id="enroltrialhead">
    <div class="container">
        <div class="row">
            <div class="col-sm-12 text-center">
                <span>{$lang.contact.contact}
            </span></div>
        </div>
    </div>
</div>

<div id="enroltrialmain">
    <div class="container">
        <div class="row">
            <div class="col-sm-8 col-sm-offset-2">
        
                <div class="row">
                    <div class="col-sm-12">
                        {if $error}
                            <div id="error" class="alert alert-danger fade in text-center">
                                <button class="close" aria-hidden="true" data-dismiss="alert" type="button">&times;</button>
                                <strong class="text-danger">{$error}</strong>
                            </div>
                        {/if}
                        <form id="contact_form" method="post" action="/process/contact-us" novalidate>
                            <div class="row">
                                <div class="col-sm-6 form-group">
                                    <label for="name">{$lang.contact.name}</label>
                                    <input type="text" id="name" name="name" value="{if $post}{$post.name}{else}{$user.gname} {$user.surname}{/if}" required="">
                                </div>
                                
                                <div class="col-sm-6 form-group">
                                    <label for="email">{$lang.contact.email}</label>
                                    <input type="email" id="email" name="email" value="{if $post}{$post.email}{else}{$user.email}{/if}" required="">
                                </div>
                                
                                <div class="col-sm-6 form-group">
                                    <label for="phone">{$lang.contact.phone}</label>
                                    <input type="text" id="phone" name="phone" value="{if $post}{$post.phone}{else}{$address.S.address_telephone}{/if}" required="">
                                </div>
                                
                                <div class="col-sm-6 form-group">
                                    <label for="postcode">{$lang.contact.postcode}</label>
                                    <input type="text" id="postcode" name="postcode" value="{if $post}{$post.postcode}{else}{$address.S.address_postcode}{/if}" pattern="[0-9]">
                                </div>
                                {if !$user.id || !$request.enquiry}
                                <div class="col-sm-12 form-group" id="hearcont">
                                    <label for="hearabout">{$lang.contact.hear}</label>
                                    <div>
                                    <select id="hearabout" tabindex="0" class="required" name="hear_about_us">
                                        <option value="">{$lang.contact.select}</option>
                                            {if $post}{assign var='selected' value=$post.hear_about_us}{else}{assign var='selected' value=$user.user_hearabout}{/if}
                                            {call name=options_list opts=$hearabout selected=$selected}
                                    </select>
                                    </div>
                                </div>
                                {/if}
                                <div class="col-sm-12 form-group">
                                    <label for="enquiry">{$lang.contact.enquiry}</label>
                                    <textarea id="inquiry" name="enquiry" required>{if $post}{$post.enquiry}{else}{$request.enquiry}{/if}</textarea>
                                </div>
                                <div class="col-sm-12 form-group hide">
                                    <label for="additional">Additional info:</label>
                                    <input type="text" id="additional" name="additional" value="" >
                                    <input type="hidden" id="reference_page" name="reference_page" value="{$listing_name}" >
                                    <input type="hidden" id="reference_page_objid" name="reference_page_objid" value="{$listing_object_id}" >
                                    <input type="hidden" id="token" name="formToken" value="{$token}" >
                                </div>
                                <div class="col-sm-12">
                                    <button class="enquire" onclick="" type="submit">{$lang.contact.submit}</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

{include file='helpblock.tpl'}

{/block}

{block name=tail}
<script type="text/javascript">
$(function(){
    $('select').selectBoxIt();
});    
$(document).ready(function(){
    
         $('#contact_form').validate();
         
         $('#postcode').rules("add", {
            digits: true,
            minlength: 4
        });

         $('#email').rules("add", {
            email: true
        });
       
});

</script>
{/block}
